<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.daz.student.information.pojo.StudentInfoPojo"%>
<%@ page import="com.opensymphony.xwork2.ActionContext"%> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>  
  	
    <title>导师制学生成长系统</title>
     <link rel="stylesheet" type="text/css" href="Ext/resources/css/ext-all.css" />
    <link rel="stylesheet" type="text/css" href="Ext/css/icon.css" />
     <link rel="stylesheet" type="text/css" href="css/print.css" />
     
    <!--  <script language="javascript" src="CheckActivX.js"></script> -->
	
    <script type="text/javascript" src="Ext/ext-all.js"></script>
    <script type="text/javascript" src="Ext/locale/ext-lang-zh_CN.js"></script>
    <script type="text/javascript" src="<%=path%>/dwr/engine.js"></script>
	<script type="text/javascript" src="<%=path%>/dwr/util.js"></script>
	<script type="text/javascript" src="<%=path%>/dwr/interface/teacherPush.js"></script>
    <script type="text/javascript" src="js/teacher/Menu.js"></script>
    <script type="text/javascript" src="js/teacher/announcement.js"></script>
    <script type="text/javascript" src="Ext/ux/form/SearchField.js"></script> 
    <script type="text/javascript" src="Ext/ux/TabCloseMenu.js"></script> 
    <script type="text/javascript" src="js/common/publicStaticData.js"></script>
    <script type="text/javascript" src="js/common/Printer.js"></script>
    
   <script type="text/javascript" src="js/student/panel/menuTree.js"></script>
    <script type="text/javascript" src="js/student/studentIndex.js"></script> 
   
    <script type="text/javascript" src="js/student/panel/menuTree.js"></script>
    <script type="text/javascript" src="js/student/panel/westPanel.js"></script>
    <script type="text/javascript" src="js/student/panel/eastPanel.js"></script>
    <script type="text/javascript" src="js/student/panel/centerPanel.js"></script>
    <script type="text/javascript" src="js/student/panel/southPanel.js"></script>
    <script type="text/javascript" src="js/student/panel/northPanel.js"></script>
    
    <script type="text/javascript" src="js/student/information.js"></script>
    <script type="text/javascript" src="js/student/changePassword.js"></script>
   
    
    <script type="text/javascript" src="js/student/selfSummary.js"></script>
    <script type="text/javascript" src="js/student/summaryList.js"></script>
    
    <script type="text/javascript" src="js/student/downloadFile.js"></script>
    <script type="text/javascript" src="js/student/downPage.js"></script>
    
    <script type="text/javascript" src="js/student/teachInfo.js"></script>
    
        <script type="text/javascript" src="js/student/changePlan.js"></script>
    
    <script type="text/javascript" src="js/student/lifePlan.js"></script>
    <script type="text/javascript" src="js/student/leaveMessage.js"></script>
    
    <script type="text/javascript" src="js/manager/inquire.js"></script>
    
    <script type="text/javascript" src="js/student/studentScore.js"></script>
    <script type="text/javascript" src="js/student/printScore.js"></script>
    
    <script type="text/javascript" src="js/student/submitHomeWork.js"></script>
    <script type="text/javascript" src="js/student/printGrowthRecord.js"></script>
     <script language="javascript" src="lodop/LodopFuncs.js"></script>
    <link rel="stylesheet" type="text/css" href="css/Main.css" />
     <link rel="stylesheet" type="text/css" href="Ext/ux/css/ItemSelector.css" />
    <style type="text/css">
        .x-grid-row td{   
  			height:30px;
  			line-height:30px;
		}
    </style>
   
   <% StudentInfoPojo userInfo = (StudentInfoPojo)ActionContext.getContext().getSession().get("userInfo"); %>
   <script>
   var name='<%= userInfo.getStudentName()%>';
   var TEACHER_ID = '<%= ActionContext.getContext().getSession().get("teacherId")%>';
	var  STUDENT_ID = '<%= ActionContext.getContext().getSession().get("studentId")%>';
   </script>
    <script type="text/javascript">  
		function on(){		
			dwr.engine.setActiveReverseAjax(true); 				  
    		dwr.engine.setNotifyServerOnPageUnload(true);  
   			var userId = '${userInfo.studentId}';
   			userId += '';
   			//alert(userId);
   			//alert("*"+userId+"*");
   			//alert(userId+"加入session");
            teacherPush.onPageLoad(userId);
            //alert(userId+"加入session成功");
		}
         //接收推送信息  
         function showMessage(autoMessage,text,studentId,name){ 
        	 //alert(autoMessage+"**"+text+"**"+studentId+"**"+name);
        	 //打开状态
        	 if(isOpenWin("150")){
        		 Ext.Ajax.request( {
        				url : "showNewMessageStrAction.action",	
        				success : function(response, option) {
        					var obj = Ext.decode(response.responseText);
        					var chat_record = new Ext.Element(document.createElement('div'));
        	        		chat_record.update(obj.msg);  
        	        		Ext.getCmp("messageList_panel").body.appendChild(chat_record);
        					///Ext.getCmp("messageList_panel").body.update(obj.msg);
        					var d = Ext.getCmp("messageList_panel").body.dom;
        					d.scrollTop = d.scrollHeight - d.offsetHeight;
        					document.getElementById("d2").innerHTML = "暂无消息";
        				},
        				failure : function(response, option) {
        					
        				}
        		    	});
        	 }else{
        		 Ext.Ajax.request( {
        				url : "qryNotLookBystudentIdAction.action", //登录处理页面	
        				success : function(response, option) {
        					var obj = Ext.decode(response.responseText);
        					if (obj.success == true) {
        						if(obj.size>0){
        							document.getElementById("d2").innerHTML = "<span style='color:red'>你有"+obj.size+"条新消息</span>";
        						}
        					} 
        				},
        				failure : function(response, option) {
        					
        				}
        				});
        	 }
        } 
         </script>
  </head>
  
  <body onload="on()">
 
  </body>
</html>
